float c, h, Omm, OmL, Omb, sigma8, rhobar, k0, kmin, ns;
double bgmin, dcmin, chi2min, chi2t, bg, dc, q, ftNL;
int NDFglobal;
double calA(double qfnl);

int TFmdm_set_cosm(float omega_matter, float omega_baryon, float omega_hdm,
	int degen_hdm, float omega_lambda, float hubble, float redshift);
float TFmdm_onek_mpc(float kk);
float TFmdm_onek_hmpc(float kk);float hubble(float z);

void TFset_parameters(float omega0hh, float f_baryon, float Tcmb);
float TFfit_onek(float k, float *tf_baryon, float *tf_cdm); 

void TFfit_hmpc(float omega0, float f_baryon, float hubble, float Tcmb,
	int numk, float *k, float *tf_full, float *tf_baryon, float *tf_cdm);

double alpha(double k);
double I1(double k);
double bias(double k, double q, double ftNL, double A, double bg, double dc, double p, double M, int z);
double hhbias(double k, double q, double ftNL, double A, double bg, double dc, double p, double M, int z);
double stoch(double k, double q, double ftNL, double A, double bg, double dc, double p, double M, int z);
double Pvar(double k, double A);
double biaschisq(double A, double dc, double q, double ftNL, char* name, double bg, double p, int M, int z);
double stochchisq(double A, double dc, double q, double ftNL, char* name, double bg, double p, double mu, int M, int z);
double TopHat(double R, double k);
double sigma8_int(double k);

double growth(double z);
double I2R2(double M);
double Mp(int M);

double F31[60], F32[60], F31D[60], F32D[60], sigmasq;

double RR(double M);
double alphaM(double k, double R);
double P(double k);
double PPhi(double A, double k, double q, double ftNL);
double Pvar(double k, double A);

double SigmaRSq(double R, double q, double ftNL, double A);
double SigmaRSqD(double R, double q, double ftNL, double A);

